import { reactive } from 'vue';
import { defineStore } from 'pinia';
import type { IThemeOpts } from '@/types/displayTheme.d';

function getDefaultTheme(): IThemeOpts {
  return {
    themeMode: 'line',
    sidebarMode: 'dark',
    primaryColor: '#18A058',
    primaryColorHover: '#36ad6a',
    primaryColorPressed: '#0C7A43',
    primaryColorSuppl: '#36AD6A'
  };
}
export const useThemeInfoStore = defineStore('themeInfo', () => {
  const themeInfo = reactive<IThemeOpts>({
    themeMode: 'line',
    sidebarMode: 'dark',
    primaryColor: '#18A058',
    primaryColorHover: '#36ad6a',
    primaryColorPressed: '#0C7A43',
    primaryColorSuppl: '#36AD6A'
  });

  const restoreDefaultTheme = () => {
    Object.assign(themeInfo, getDefaultTheme());
  };

  return {
    themeInfo,
    restoreDefaultTheme
  };
});
